export default {
	methods: {
		//cdnurl
		cdnurl() {
			if (!/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/.test(url)) {
				return this.vuex_config.config.upload.cdnurl + url;
			};
			return url;
		},
		//页面跳转
		navTo(url, data, type) {
			const tabBarLinks = [
				'pages/index/index',
				'pages/user/index'
			];
			if (this.$util.in_array(url, tabBarLinks)) {
				type = 'switchTab';
			}
			this.$u.route({
				type: type || 'navigateTo',
				url: url,
				params: data
			})
		}
	}
}
